<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateActWishTreeGiftTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('act_wish_tree_gift', function (Blueprint $table) {
            $table->smallIncrements('id');
            $table->unsignedSmallInteger('gift_id')->default(0)->comment('礼物ID');
            $table->double('gift_percent', 5, 3)->default(0.00)->comment('配置概率');
            $table->unsignedInteger('gift_num')->default(0)->comment('总数');
            $table->timestamps();
            $table->unsignedTinyInteger('flag')->default(1)->comment('状态：1-有效，0-无效');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('act_wish_tree_gift');
    }
}
